import { BASE_URI } from "@/utils/const";
import request from '@/utils/request.js'
const GOODS_BASE_URL = '/goods';
export default {
    getGoodsList(queryGoodsDto){
        return request({
            url: BASE_URI + GOODS_BASE_URL + '/goodsList',
            data:{
                "page_no":queryGoodsDto.pageNo,
                "page_size":queryGoodsDto.pageSize,
                "goods_name":queryGoodsDto.goodsName,
                "cate_name":queryGoodsDto.goodsCateName,
                "warehouse_name":queryGoodsDto.warehouseName
            },
            method: 'post'
        })
    },
    saveGoods(goodsDto){
        return request({
            url: BASE_URI + GOODS_BASE_URL + '/saveGoods',
            data:{
                "user_account":goodsDto.userAccount,
                "user_name":goodsDto.userName,
                "user_phone":goodsDto.userPhone,
                "goods_name":goodsDto.goodsName,
                "warehouse_name":goodsDto.warehouseName,
                "cate_name":goodsDto.cateName
            },
            method: 'post'
        })
    },
    updateGoods(goodsDto){
        return request({
            url: BASE_URI + GOODS_BASE_URL + '/update',
            data:{
                "id":goodsDto.id,
                "goods_name":goodsDto.goodsName,
                "warehouse_name":goodsDto.warehouseName,
                "cate_name":goodsDto.cateName
            },
            method: 'post'
        })
    }
}